<?php
/**
 * Parameters
 * @param	array	$work_items
 */
  use_helper('Date');
?>
			<table class="data display datatable">
				<thead>
					<tr>
						<th>Betreff</th>
						<th>Datum</th>
					</tr>
				</thead>
				<tbody>
				<?php if(count($work_items) > 0):?>
				<?php foreach($work_items as $i => $work_item):?>
				    <?php $id = sprintf('work_item_%s', $work_item->getObject()->getId());?>
					<tr>
						<?php $class = !$work_item->getObject()->getIsRead() ? 'unread' : null;?>
						<td class="<?php echo $class?>">
							<a href="<?php echo url_for('wf_workflow_inbox_message_show', $work_item->getObject());?>" id="<?php echo $id;?>"><?php echo $work_item->getSubject()?></a>
						</td>
						<td><?php echo format_date($work_item->getObject()->getCreatedAt(), 'd. MMMM yyyy, H:mm')?> Uhr</td>
					</tr>
					<script type="text/javascript">workflow_inbox_register_load_message('<?php echo $id?>', '<?php echo url_for('wf_workflow_inbox_message_show_ajax', $work_item->getObject(), true)?>');</script>
				<?php endforeach;?>
				<?php else:?>
					<tr>
						<td colspan="2">Keine Nachrichten gefunden.</td>
					</tr>
				<?php endif;?>
				</tbody>
			</table>